#include "point.h"

namespace zgq
{
	bool Point::operator!=(const Point& data)
	{
		return !(*this == data);
	}

	Point::Point() :m_X(0), m_Y(0) {
	}


	Point::Point(int x, int y)
	{
		m_X = x;
		m_Y = y;
	}

	Point::Point(const Point& data)
	{
		m_X = data.m_X;
		m_Y = data.m_Y;
	}

	Point Point::operator+(const Point& data)
	{
		return Point(m_X +data.m_X, m_Y +data.m_Y);
	}

	Point Point::operator-(const Point& data)
	{
		return Point(m_X -data.m_X, m_Y -data.m_Y);
	}

	bool Point::operator==(const Point& data)
	{
		return (m_X == data.m_X)&&(m_Y == data.m_Y);
	}

	void Point::operator=(const Point& data)
	{
		m_X = data.m_X;
		m_Y = data.m_Y;
	}

	void Point::setX(int x)
	{
		m_X = x;
	}

	void Point::setY(int y)
	{
		m_Y = y;
	}

	int Point::x() const
	{
		return m_X;
	}
	int Point::y() const 
	{
		return m_Y;
	};

	std::ostream& operator<<(std::ostream& os, const Point& data)
	{
		os << "zgq::Point(" << data.m_X << "," << data.m_Y << ")";
		return os;
	}
}

